#!/bin/bash

dir=$(ls *.cer)
#mkdir temp
for unpath in $dir
do
     
filename=$(basename "$unpath")
filename="${filename%.*}"

openssl x509 -in $unpath -inform der -out ./temp/$unpath.pem
openssl pkcs12 -nocerts -out ./temp/$filename.p12.pem -in $filename.p12

cat ./temp/$unpath.pem ./temp/$filename.p12.pem  > ./all/$filename.pem

done 
